package nix.ajax.web.servlet;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class ValidateServlet extends HttpServlet {

	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		request.setCharacterEncoding("utf-8");
		response.setContentType("text/html;charset=utf-8");
		
		String username  = request.getParameter("username");
		if (username.equalsIgnoreCase("zhangsan")) {
			response.getWriter().print("0");
		} else {
			response.getWriter().print("1");
		}
	}

}
